{include file="common_top.html"}
{include file="common_head.html"}
{include file="common_center.html"}
<div class="table_detail">
	<h2>单任务信息</h2>
	<form action="/index.php?a=tasksingle&m=edit&t=ajax" method="POST" onsubmit="return $.fn.ajaxForm(this);">
		<input type="hidden" name="id" value="{$id}" />
		<table class="table_detail">
			<tbody align="left" valign="top">
				{if $id > 0}<tr><th>编号</th><td>{$object.id}</td></tr>{/if}
				<tr><th width="120px">目标地址</th><td><input type="text" class="w200" name="target_contact" value="{if $id > 0}{$object.target.contact}{/if}" /></td></tr>
				<tr><th>任务类型</th><td class="rowtabs">
					<input type="radio" id="type_tabs_1" data-tab=".type_tabs_1" value="1" name="type" {if $id > 0 && $object.channel.type == 1}checked="checked"{/if} /><label for="type_tabs_1">邮件</label>
					<input type="radio" id="type_tabs_2" data-tab=".type_tabs_2" value="2" name="type" {if $id > 0 && $object.channel.type == 2}checked="checked"{/if} /><label for="type_tabs_2">短信</label>
				</td></tr>
				<tr class="type_tabs_1"><th>邮件标题</th><td><input type="text" class="w450" name="title" value="{if $id > 0}{$object.title}{/if}" /></td></tr>
				<tr class="type_tabs_1"><th>邮件内容</th><td><textarea class="w450 h100" name="content1">{if $id > 0}{$object.content}{/if}</textarea></td></tr>
				<tr class="type_tabs_1"><th>邮件通道</th><td>
					<div class="radiolist">
						{foreach from=$channel_list item=v key=k}
							{if !$v.is_disable && $v.type == 1 && $v.id|in_array:$user_channel_list}
								<input type="radio" id="{$v.name}{$v.id}" value="{$v.id}" name="channel_id" {if $id > 0 && $object.channel_id == $v.id}checked="checked"{/if} /><label for="{$v.name}{$v.id}">{$v.name}</label>
							{/if}
						{/foreach}
					</div>
				</td></tr>
				<tr class="type_tabs_2"><th>字数统计</th><td><span class="content2_output">0</span> 个字</td></tr>
				<tr class="type_tabs_2"><th>短信内容</th><td>
					<textarea class="w450 h100 wordstata" name="content2" data-output=".content2_output">{if $id > 0}{$object.content}{/if}</textarea>
				</td></tr>
				<tr class="type_tabs_2"><th>短信通道</th><td>
					<div class="radiolist">
						{foreach from=$channel_list item=v key=k}
							{if !$v.is_disable && $v.type == 2 && $v.id|in_array:$user_channel_list}
								<input type="radio" id="{$v.name}{$v.id}" value="{$v.id}" name="channel_id" {if $id > 0 && $object.channel_id == $v.id}checked="checked"{/if} /><label for="{$v.name}{$v.id}">{$v.name}</label>
							{/if}
						{/foreach}
					</div>
				</td></tr>
				<tr><th>计划发送时间</th><td><input type="text" class="datetimepicker" name="plan_send_time" value="{if $id > 0}{$object.plan_send_time|date_format:"%Y-%m-%d %H:%M:%S"}{/if}" /></td></tr>
				<tr><td>&nbsp;</td><td>
					<input type="submit" class="btn" value="保存" />
					{if $id > 0}<input type="button" class="mgl20 btn link" value="查看" data-href="/index.php?a=tasksingle&m=detail&id={$object.id}" />{/if}
					{if $id > 0 && 'TASKSINGLE:CANCEL'|in_array:$userpower}<input type="button" class="mgl20 btn ajaxlink" data-url="/index.php?a=tasksingle&m=cancel&t=ajax&id={$object.id}" value="取消发送" />{/if}
				</td></tr>
			</tbody>
		</table>
	</form>
</div>
{include file="common_bottom.html"}
